<?php


namespace App\Services;


class conditionService
{
    //1000米内
    const DISTANCE_1 = 1000;
    //2000米内
    const DISTANCE_2 = 2000;
    //3000米内
    const DISTANCE_3 = 3000;
    //5000米内
    const DISTANCE_4 = 4000;
    //不限
    const DISTANCE_5 = 1000000000;

    /**
     * @Notes:距离
     * @Author:Planb,
     * @Date: 2022/11/23,
     * @Time: 15:41,
     */
    public static function distance($distance)
    {
        switch ($distance) {
            case 'DISTANCE_1':
                return self::DISTANCE_1;
                break;
            case 'DISTANCE_2':
                return self::DISTANCE_2;
                break;
            case 'DISTANCE_3':
                return self::DISTANCE_3;
                break;
            case 'DISTANCE_4':
                return self::DISTANCE_4;
                break;
            default:
                return self::DISTANCE_5;
        }
    }

    /**
     * @Notes:筛选价格
     * @Author:Planb,
     * @Date: 2022/11/23,
     * @Time: 16:16,
     */
    public static function price($price)
    {
        switch ($price) {
            case 'PRICE_1':
                return ['min' => 0, 'max' => 999];
                break;
            case 'PRICE_2':
                return ['min' => 1000, 'max' => 9999];
                break;
            case 'PRICE_3':
                return ['min' => 10000, 'max' => 99999];
                break;
            case 'PRICE_4':
                return ['min' => 0, 'max' => 9999999999999];
                break;
            default:
                return ['min' => 0, 'max' => 9999999999999];
        }
    }


}
